package ysq.xyg.host.service;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import ysq.xyg.base.model.dto.ReturnEntity;
import ysq.xyg.base.service.BaseService;
import ysq.xyg.host.model.po.CityDTO;
import ysq.xyg.host.model.po.CityDataDTO;
import ysq.xyg.host.model.po.HostCity;
import ysq.xyg.host.model.vo.HostCityVo;
import ysq.xyg.sys.model.po.SysUser;

import java.util.List;

/**
 * 房产模块-城市service接口
 *
 * @author shengQiang yu
 * @date 2019-7-1 13:49:33
 */
public interface HostCityService extends BaseService<HostCity> {

    /**
     * 分页查询
     *
     * @param hostCityVo 对象
     * @param pageSize 当前页面
     * @param pageNum 页面数量
     * @return ReturnEntity 对象
     * @author shengQiang yu
     * @date 2019-7-1 13:49:33
     */
    ReturnEntity page(HostCityVo hostCityVo, int pageSize, int pageNum);

    /**
     * 修改
     *
     * @param hostCityVo 对象
     * @param currentUser 当前用户
     * @return ReturnEntity 对象
     * @author shengQiang yu
     * @date 2019-7-1 13:49:33
     */
    @CacheEvict(value={"hostCitySelectList", "hotHostCitySelectList"}, allEntries=true)
    ReturnEntity addOrUpdate(HostCityVo hostCityVo, SysUser currentUser);

    /**
     * 删除
     *
     * @param id 主键id删除
     * @param currentUser 当前用户
     * @return ReturnEntity 对象
     * @author shengQiang yu
     * @date 2019-7-1 13:49:33
     */
    @CacheEvict(value={"hostCitySelectList", "hotHostCitySelectList"}, allEntries=true)
    ReturnEntity delete(String id, SysUser currentUser);

    /**
     * 获取下拉框集合
     *
     * @param code code值
     * @author shengQiang yu
     * @date 2019-4-25 16:49:54
     */
    ReturnEntity acceptSelect(String code);

    /**
     * 获取集合
     *
     * @param hostCityVo 对象
     * @return List<HostCity> HostCity集合
     * @author shengQiang yu
     * @date 2019-7-1 13:49:33
     */
    List<HostCity> acceptList(HostCityVo hostCityVo);

    /**
     * 取第一个city
     * @param cityId
     * @author congcong tao
     * @date 2019/9/4 11:47
     */
    HostCity selectFirstCity(String cityId);

    /**
     * 根据size取城市
     * @param size
     * @author congcong tao
     * @date 2019/9/4 11:59
     */
    List<HostCity> selectCityBySize(int size);

    @Cacheable(value="hostCitySelectList")
    List<CityDTO> hostCitySelectList();

    @Cacheable(value="hotHostCitySelectList")
    List<CityDataDTO> hotHostCityList();
}
